#索引切片
msg = "hello Nick"
#切片顾头不顾尾
print(msg)
print(f'切片3到最后：{msg[3:]}')
print(f'切片3-8:{msg[3:8]}')
print(f'切片3-8，步长为2:{msg[3:8:2]}')
print(f'切片3到最后，步长为2:{msg[3::2]}')

#了解，步长为正从左到右，步长为负从右到左
print("\n了解所有知识点")
print(f'切片所有:{msg[:]}')
print(f'反转所有：{msg[::-1]}')
print(f'切片-5--2：{msg[-5:-2]}')
print(f'切片从-2--5:{msg[-2:-5:-1]}')